package com.netrust.cmsx.entity.module.sys;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.netrust.cmsx.core.persist.TreeEntity;

@Entity
@Table(name = "sys_dict")
public class Dict extends TreeEntity<Dict>{

	private static final long serialVersionUID = -4579341661032136664L;
	
	@Column(name = "code")
	@NotNull
	private String code;      //编码
	
	@Column(name = "parent_ids")
	@NotNull
	private String pids;      //编码

	@Column(name = "value")
	@Length(min=0, max=100)
	private String value;      //值

	@Column(name = "label")
	@Length(min=0, max=100)
	private String lable;      //名称

	@Column(name = "type")
	@Length(min=0, max=100)
	private String type;    //类型
	
	@Column(name = "sort")
	@NotNull
	private Integer sort;    //排序
	
	@Column(name = "description")
	@Length(min=0, max=100)
	private String description;//说明

	@Column(name = "del_flag")
	@NotNull
	private boolean delFlag;//说明

	public Dict(){}
 
	public Dict(String id){
		super(id);
		delFlag=false;
	}
	
	public String getPids() {
		return pids;
	}

	public void setPids(String pids) {
		this.pids = pids;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getLable() {
		return lable;
	}

	public void setLable(String lable) {
		this.lable = lable;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isDelFlag() {
		return delFlag;
	}

	public void setDelFlag(boolean delFlag) {
		this.delFlag = delFlag;
	}

	@Override
	public String toString() {
		return "Dict [code=" + code + ", pids=" + pids + ", value=" + value + ", lable=" + lable + ", type=" + type
				+ ", sort=" + sort + ", description=" + description + ", delFlag=" + delFlag + "]";
	}

}
